<!DOCTYPE html>



  


<html class="theme-next mist use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">



  
  
    
    
  <script src="/myblogs/lib/pace/pace.min.js?v=1.0.2"></script>
  <link href="/myblogs/lib/pace/pace-theme-minimal.min.css?v=1.0.2" rel="stylesheet">







<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/myblogs/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/myblogs/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/myblogs/css/main.css?v=5.1.4" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/myblogs/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/myblogs/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/myblogs/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/myblogs/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="IDEA," />





  <link rel="alternate" href="/myblogs/atom.xml" title="天行健の博客" type="application/atom+xml" />






<meta name="description" content="#首页只会显示标记以前的内容，标记后的内容可以通过阅读更多查阅  自己使用IDEA时整理了一些教程，在这里保存下来   注意：这里面 web app 的骨架有2个，需要匹配第二个才是需要的 ，所以需要注意。   给自己的项目的本地仓库，默认是在c盘的.m2文件夹下， 但是这很是占用**c**盘本来就不算大的系统盘的地方。 所以这里可以这么配置就可以把本地仓库移动到c盘之外的任意地方。就这">
<meta property="og:type" content="article">
<meta property="og:title" content="IDEA使用教程">
<meta property="og:url" content="https://joy_24.gitee.io/2020/11/25/ideaUseTutorial/index.html">
<meta property="og:site_name" content="天行健の博客">
<meta property="og:description" content="#首页只会显示标记以前的内容，标记后的内容可以通过阅读更多查阅  自己使用IDEA时整理了一些教程，在这里保存下来   注意：这里面 web app 的骨架有2个，需要匹配第二个才是需要的 ，所以需要注意。   给自己的项目的本地仓库，默认是在c盘的.m2文件夹下， 但是这很是占用**c**盘本来就不算大的系统盘的地方。 所以这里可以这么配置就可以把本地仓库移动到c盘之外的任意地方。就这">
<meta property="og:locale">
<meta property="og:image" content="https://joy_24.gitee.io/myblogs/2020/11/25/ideaUseTutorial/20170319131312929.png">
<meta property="og:image" content="https://joy_24.gitee.io/myblogs/2020/11/25/ideaUseTutorial/20170319131326117.png">
<meta property="og:image" content="https://joy_24.gitee.io/myblogs/2020/11/25/ideaUseTutorial/20170319131503135.png">
<meta property="og:image" content="https://joy_24.gitee.io/myblogs/2020/11/25/ideaUseTutorial/20170319131520213.png">
<meta property="og:image" content="https://joy_24.gitee.io/myblogs/2020/11/25/ideaUseTutorial/20170319132126621.png">
<meta property="og:image" content="https://joy_24.gitee.io/myblogs/2020/11/25/ideaUseTutorial/20170319132141059.png">
<meta property="og:image" content="https://joy_24.gitee.io/myblogs/2020/11/25/ideaUseTutorial/20170319132751000.png">
<meta property="og:image" content="https://joy_24.gitee.io/myblogs/2020/11/25/ideaUseTutorial/20170319132800764.png">
<meta property="og:image" content="https://joy_24.gitee.io/myblogs/2020/11/25/ideaUseTutorial/20170319132814594.png">
<meta property="og:image" content="https://joy_24.gitee.io/myblogs/2020/11/25/ideaUseTutorial/20170319132840344.png">
<meta property="og:image" content="https://joy_24.gitee.io/myblogs/2020/11/25/ideaUseTutorial/20170629101346633.png">
<meta property="og:image" content="https://joy_24.gitee.io/myblogs/2020/11/25/ideaUseTutorial/20170629101401439.png">
<meta property="og:image" content="https://joy_24.gitee.io/myblogs/2020/11/25/ideaUseTutorial/20170629101415530.png">
<meta property="og:image" content="https://joy_24.gitee.io/myblogs/2020/11/25/ideaUseTutorial/20170629101425730.png">
<meta property="og:image" content="https://joy_24.gitee.io/myblogs/2020/11/25/ideaUseTutorial/20170319132853094.png">
<meta property="og:image" content="https://joy_24.gitee.io/myblogs/2020/11/25/ideaUseTutorial/20170319132905140.png">
<meta property="og:image" content="https://joy_24.gitee.io/myblogs/2020/11/25/ideaUseTutorial/20170319132945079.png">
<meta property="og:image" content="https://joy_24.gitee.io/myblogs/2020/11/25/ideaUseTutorial/20170319133106439.png">
<meta property="og:image" content="https://joy_24.gitee.io/myblogs/2020/11/25/ideaUseTutorial/20170319133334895.png">
<meta property="og:image" content="https://joy_24.gitee.io/myblogs/2020/11/25/ideaUseTutorial/20170319133529351.png">
<meta property="og:image" content="https://joy_24.gitee.io/myblogs/2020/11/25/ideaUseTutorial/20170319133634414.png">
<meta property="og:image" content="https://joy_24.gitee.io/myblogs/2020/11/25/ideaUseTutorial/20170319133912521.png">
<meta property="og:image" content="https://joy_24.gitee.io/myblogs/2020/11/25/ideaUseTutorial/20170319134101405.png">
<meta property="og:image" content="https://joy_24.gitee.io/myblogs/2020/11/25/ideaUseTutorial/20170319134907543.png">
<meta property="og:image" content="https://joy_24.gitee.io/myblogs/2020/11/25/ideaUseTutorial/20170319134920137.png">
<meta property="og:image" content="https://joy_24.gitee.io/myblogs/2020/11/25/ideaUseTutorial/20170319134930167.png">
<meta property="article:published_time" content="2020-11-25T07:08:18.000Z">
<meta property="article:modified_time" content="2021-10-26T07:01:01.928Z">
<meta property="article:author" content="Joy Wang">
<meta property="article:tag" content="IDEA">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://joy_24.gitee.io/myblogs/2020/11/25/ideaUseTutorial/20170319131312929.png">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '',
    scheme: 'Mist',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":true,"scrollpercent":true,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://joy_24.gitee.io/2020/11/25/ideaUseTutorial/"/>





  <title>IDEA使用教程 | 天行健の博客</title>
  








<meta name="generator" content="Hexo 5.2.0"></head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>
    <a target="_blank" rel="noopener" href="https://github.com/JoyWJ" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>


    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/myblogs/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">天行健の博客</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">一个开发博客的初学者。</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/myblogs/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/myblogs/about" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/myblogs/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/myblogs/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/myblogs/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-commonweal">
          <a href="/myblogs/404.html" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-heartbeat"></i> <br />
            
            公益404
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="popup-trigger">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br />
            
            搜索
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  <div class="popup search-popup local-search-popup">
  <div class="local-search-header clearfix">
    <span class="search-icon">
      <i class="fa fa-search"></i>
    </span>
    <span class="popup-btn-close">
      <i class="fa fa-times-circle"></i>
    </span>
    <div class="local-search-input-wrapper">
      <input autocomplete="off"
             placeholder="搜索..." spellcheck="false"
             type="text" id="local-search-input">
    </div>
  </div>
  <div id="local-search-result"></div>
</div>



    </div>
  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://joy_24.gitee.io/myblogs/2020/11/25/ideaUseTutorial/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/myblogs/uploads/avatar.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="天行健の博客">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">IDEA使用教程</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2020-11-25T15:08:18+08:00">
                2020-11-25
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/myblogs/categories/IDE/" itemprop="url" rel="index">
                    <span itemprop="name">IDE</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          
            <div class="post-wordcount">
              
                
                <span class="post-meta-item-icon">
                  <i class="fa fa-file-word-o"></i>
                </span>
                
                  <span class="post-meta-item-text">字数统计&#58;</span>
                
                <span title="字数统计">
                  2.5k
                </span>
              

              
                <span class="post-meta-divider">|</span>
              

              
                <span class="post-meta-item-icon">
                  <i class="fa fa-clock-o"></i>
                </span>
                
                  <span class="post-meta-item-text">阅读时长 &asymp;</span>
                
                <span title="阅读时长">
                  9
                </span>
              
            </div>
          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <a id="more"></a>     #首页只会显示标记以前的内容，标记后的内容可以通过阅读更多查阅

<p>自己使用IDEA时整理了一些教程，在这里保存下来</p>
<p><img src="/myblogs/2020/11/25/ideaUseTutorial/20170319131312929.png"></p>
<p><img src="/myblogs/2020/11/25/ideaUseTutorial/20170319131326117.png"></p>
<p>注意：这里面 web app 的骨架有2个，需要匹配第二个才是需要的 ，所以需要注意。</p>
<p><img src="/myblogs/2020/11/25/ideaUseTutorial/20170319131503135.png"></p>
<p><img src="/myblogs/2020/11/25/ideaUseTutorial/20170319131520213.png"></p>
<p>给自己的项目的本地仓库，默认是在c盘的.m2文件夹下，</p>
<p>但是<strong>这很是占用**</strong>c**<strong>盘本来就不算大的系统盘的地方</strong>。</p>
<p>所以这里可以这么配置就可以把本地仓库移动到c盘之外的任意地方。就这么做就可以啦。</p>
<p>另外使用的是国内的阿里的仓库。下载速度快。</p>
<p>参考文献：</p>
<p>1，[ maven 本地仓库的配置以及如何修改默认.m2仓库位置](onenote:#maven 本地仓库的配置以及如何修改默认.m2仓库位置&amp;section-id={0BF884F1-BD40-4B89-B625-C173B78E0670}&amp;page-id={4A0D6CAE-3032-42CC-8632-33908F5B360C}&amp;end&amp;base-path=<a target="_blank" rel="noopener" href="https://d.docs.live.net/2fd66831a7ab4b8d/%E6%96%87%E6%A1%A3/%E5%B7%A5%E4%BD%9C%E7%AC%94%E8%AE%B0%E6%9C%AC/%E7%9F%A5%E8%AF%86%E8%AE%B0%E5%BD%95%E6%9C%AC.one">https://d.docs.live.net/2fd66831a7ab4b8d/文档/工作笔记本/知识记录本.one</a>)</p>
<p>2，[maven 阿里云 国内镜像 中央仓库 亲测可用](onenote:#maven 阿里云 国内镜像 中央仓库 亲测可用&amp;section-id={0BF884F1-BD40-4B89-B625-C173B78E0670}&amp;page-id={EFFA9D40-0EB4-420C-B273-9D431A08C2DA}&amp;end&amp;base-path=<a target="_blank" rel="noopener" href="https://d.docs.live.net/2fd66831a7ab4b8d/%E6%96%87%E6%A1%A3/%E5%B7%A5%E4%BD%9C%E7%AC%94%E8%AE%B0%E6%9C%AC/%E7%9F%A5%E8%AF%86%E8%AE%B0%E5%BD%95%E6%9C%AC.one">https://d.docs.live.net/2fd66831a7ab4b8d/文档/工作笔记本/知识记录本.one</a>)</p>
<p>上面截图上说的有点不地道，不能一个项目使用一个仓库，这样的话重复的东西会太多，是我表述不清楚了，其实目的是，节约c盘的地方。可以按照上面的链接把这个仓库按照到c盘之外的其他地方就OK啦。</p>
<p><img src="/myblogs/2020/11/25/ideaUseTutorial/20170319132126621.png"></p>
<p><img src="/myblogs/2020/11/25/ideaUseTutorial/20170319132141059.png"></p>
<p>这个时候，可以看到，图中蓝色的地址，看到aliyun这个词了吧，就是阿里整的这个国内镜像仓库吧。下载速度还是很快的，嗖嗖嗖就好啦。</p>
<p>点击图上的<strong>“Import Changes”</strong>，因为是maven项目，所以<strong>当依赖包发生变化时</strong>，也就是<strong>pom.xml**</strong>文件有修改的时候。**</p>
<p>他就得重新检查下包的依赖，没有的，自己会去下载的。这个要记住啦，因为maven项目的话，这个基本是天天见的，要熟悉。</p>
<p>执行完之后，你可以去看，<strong>你刚刚新建的那个本地仓库的那个空文件夹，发现你需要的项目依赖的各种**</strong>jar**<strong>包都下载下来啦。</strong></p>
<p>如果一切都OK的话，那么下面就该准备tomcat啦。</p>
<p>继续看图。</p>
<p><img src="/myblogs/2020/11/25/ideaUseTutorial/20170319132751000.png"></p>
<p>到这之后，有的同学，反应：<strong>“**</strong>我的编辑器这，怎么没有这一行呢？**<strong>”</strong></p>
<p>请看下面链接，如何把这个给搞出来。hello world项目跑完，顺带学习一下怎么使用这个编辑器，也是极好的。</p>
<p>[IntelliJ IDEA中如何显示和关闭—-工具栏，目录栏](onenote:#IntelliJ IDEA中如何显示和关闭—-工具栏，目录栏&amp;section-id={0BF884F1-BD40-4B89-B625-C173B78E0670}&amp;page-id={6C0F7BA1-0A1B-4884-929D-C7216AC5AA41}&amp;end&amp;base-path=<a target="_blank" rel="noopener" href="https://d.docs.live.net/2fd66831a7ab4b8d/%E6%96%87%E6%A1%A3/%E5%B7%A5%E4%BD%9C%E7%AC%94%E8%AE%B0%E6%9C%AC/%E4%B8%B4%E6%97%B6%E8%AE%B0%E5%BD%95%E6%9C%AC.one">https://d.docs.live.net/2fd66831a7ab4b8d/文档/工作笔记本/临时记录本.one</a>)</p>
<p>这一行里面的按钮还是比较常用的。</p>
<p><img src="/myblogs/2020/11/25/ideaUseTutorial/20170319132800764.png"></p>
<p><strong>注意，是点那个加号，再去配置的，而不是直接点下面的。</strong></p>
<p><img src="/myblogs/2020/11/25/ideaUseTutorial/20170319132814594.png"></p>
<p><img src="/myblogs/2020/11/25/ideaUseTutorial/20170319132840344.png"></p>
<p>估计有的小伙伴们到这个地方，哎，发现，我怎么就只有一个选项呀，<strong>artifact**</strong>这个选项怎么没有呢？**</p>
<p>不要惊慌，</p>
<p>方法一：</p>
<p>先看文章最底部的更新内容，看看是不是因为安装的编辑器不是开发版，也就是说你安装的是免费版的，那可能就是少了下面的插件。</p>
<p>看看安装之后，是不是就可以搞定问题啦。</p>
<p>后经有同学反应，你搜索不到插件的，是因为你使用的阉割版的，建议安装专业版，也就是付费的。</p>
<p>方法二：</p>
<p><img src="/myblogs/2020/11/25/ideaUseTutorial/20170629101346633.png"></p>
<p><img src="/myblogs/2020/11/25/ideaUseTutorial/20170629101401439.png"></p>
<p><img src="/myblogs/2020/11/25/ideaUseTutorial/20170629101415530.png"></p>
<p><img src="/myblogs/2020/11/25/ideaUseTutorial/20170629101425730.png"></p>
<p>到这，你就可以添加了，或者直接点右下角的那个fix，估计一下就自动，给搞定了，继续吧。</p>
<p>**更新完毕。</p>
<p><img src="/myblogs/2020/11/25/ideaUseTutorial/20170319132853094.png"></p>
<p><img src="/myblogs/2020/11/25/ideaUseTutorial/20170319132905140.png"></p>
<p><img src="/myblogs/2020/11/25/ideaUseTutorial/20170319132945079.png"></p>
<p>在 Java Web 开发中， 一般更新了 Java 文件后要手动重启 Tomcat 服务器， 才能生效， 有印象没？我是真的遇到过，当时用的编辑器是eclipse，使用的服务器好像是jboss，浪费不少生命啊， 你如上配置的话， 不论是更新 class 类，css文件，html文件，js文件，还是更新 Spring 配置文件都能做到立马生效，大大提高开发效率。</p>
<p>我最下面示范的，我说一刷新页面，就可以看到我修改后的效果，就是简单给你演示下热部署功能的好处。</p>
<p>给你省去了重启tomcat的时间。</p>
<p><img src="/myblogs/2020/11/25/ideaUseTutorial/20170319133106439.png"></p>
<p>箭头指向的这一栏，这个是你配置tomcat之后，才有的，OK？</p>
<p>这个也许你知道呢，但是我就爱啰嗦。</p>
<p>debug就是启动的时候，你可以直接在代码里面点个断点就可以debug调试啦，你要是直接启动，那么你就不能debug调试啦。</p>
<p>当然啦在实际开发中，一般都是debug模式启动的，因为你开发过程中要调试各种代码和bug。</p>
<p>所以，debug启动在开发过程使用的是很多的。</p>
<p><img src="/myblogs/2020/11/25/ideaUseTutorial/20170319133334895.png"></p>
<p>自动弹出个网页，是因为你在上面配置tomcat的时候，自己配置的，造吗？回头看一下，有个open browse after launch，配置打开的还是chrome浏览器。</p>
<p>chrome浏览器，是web开发建议使用的浏览器。</p>
<p>至此，这个<strong>创建**</strong>maven** <strong>管理的**</strong>Java web**<strong>项目的**</strong>hello world**就算完成 了。</p>
<p>你要是掌握了这个，那么<strong>基本上**</strong>Java web**<strong>开发都是这么个套路</strong>，起码<strong>创建**</strong>tomcat**<strong>这个套路</strong>就是这么滴。学会这个就很好啦。</p>
<p>下面再 给看看新建的项目的文件目录结构的样子。</p>
<p><img src="/myblogs/2020/11/25/ideaUseTutorial/20170319133529351.png"></p>
<p>有小伙伴表示，我怎么没有target这个文件夹呢？</p>
<p>表着急，这个是web项目运行之后，把东西打包到这个地方的。自动生成的，你项目页面还没跑起来，先表激动为啥我没有这个文件夹.</p>
<p>我表示，我现在基本上天天看的都是这么个界面吧，大同小异啦。</p>
<p>所以，作为观众的你，提前熟悉一下，也是没什么坏处的咯。</p>
<p><img src="/myblogs/2020/11/25/ideaUseTutorial/20170319133634414.png"></p>
<p><strong>这个我就是给你示范一下，实际开发中，为什么要在**</strong>tomcat**<strong>里面那么配置个热部署的功能吧算是。</strong></p>
<p>因为你在开发的时候，你修改个页面的文字啥的，总是去停了再启动一下tomcat，太啰嗦。</p>
<p>所以，你按我上面配置tomcat的姿势，配置好了tomcat之后，修改完之后，只要刷新下浏览器页面，就可以发现，刚刚做的修改，在没有重启tomcat的情况下 ，就可看到效果。这就完美的解决“<strong>动不动就重启下**</strong>tomcat**<strong>服务器，浪费时间</strong>”的这个重复的问题，多好。</p>
<p>我说的这些，可能你花钱去培训也不一定知道哦。</p>
<p><img src="/myblogs/2020/11/25/ideaUseTutorial/20170319133912521.png"></p>
<p>这张图，<strong>是我在**</strong>index.jsp**<strong>文件上添加了汉字之后，没有重启**</strong>tomcat**<strong>，直接在浏览器页面，刷新一下，就看到了效果啦。</strong></p>
<p>呵呵，小意外。乱码了。。。。。。。。。。。</p>
<p>虽然，你看到我的页面上出了乱码，但是实际开发过程中，你也可能出现这个情况，现在我告诉你怎么解决，其实就这一张图就是一个问题。</p>
<p>就是你的网页上某个地方乱码啦，你怎么去处理。</p>
<p>因为我没有对这个页面的编码方式进行设置，所以，就 乱码啦，具体解决方案就看下一张图。</p>
<p><img src="/myblogs/2020/11/25/ideaUseTutorial/20170319134101405.png"></p>
<p>我又在文件上添加了一行代码，然后再次刷新下浏览器页面，OK。</p>
<p>页面上的汉字就显示正常啦。 </p>
<p>把用到的这句话放这儿吧，估计看官的你也懒得敲。就想着复制粘贴呢。还不知道你。。。。哼。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&lt;%@ page language&#x3D;&quot;java&quot; contentType&#x3D;&quot;text&#x2F;html; charset&#x3D;UTF-8&quot; pageEncoding&#x3D;&quot;UTF-8&quot;%&gt;</span><br></pre></td></tr></table></figure>

<p>这下看到了，我在实际开发中也出现过类似的问题，就是某个模块，就是乱码，不知道为啥，当然，也是浪费了点时间，知道在页面上没有设置编码格式，所以才会乱码的，那么你现在看到我告诉你如何解决这个问题啦，你要是在实际工作中也遇到这个问题的话，那么，你就可以很轻松的解决这个问题。这个也是极好的啦。</p>
<p>下面说，我的那个<strong>maven**</strong>的配置文件的内容**。主要里面就配置了2点。</p>
<p>1，就是把本地仓库的地址，自定义到我的e盘的某个文件夹下。</p>
<p>2，配置国内的镜像仓库地址，使用阿里云的maven镜像仓库。</p>
<p>具体内容如下：</p>
<p>如果你不想去看上面的2个链接的话：直接复制下面内容，然后再修改你自己电脑上的某个文件夹作为你的本地仓库地址就可以啦。</p>
<p>哎，算了，太长了。我就只贴出来关键代码，你自己去你安装的maven的文件目录下复制个setting.xml文件过来修改吧。我就不整个贴啦。</p>
<p>还是看图吧：</p>
<p><img src="/myblogs/2020/11/25/ideaUseTutorial/20170319134907543.png"></p>
<p><img src="/myblogs/2020/11/25/ideaUseTutorial/20170319134920137.png"></p>
<p><img src="/myblogs/2020/11/25/ideaUseTutorial/20170319134930167.png"></p>
<p>关于图中的镜像仓库的地址的文字如下：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">&lt;mirror&gt;    </span><br><span class="line">	&lt;id&gt;alimaven&lt;&#x2F;id&gt;    </span><br><span class="line">	&lt;name&gt;aliyun maven&lt;&#x2F;name&gt;    </span><br><span class="line">	&lt;url&gt;http:&#x2F;&#x2F;maven.aliyun.com&#x2F;nexus&#x2F;content&#x2F;groups&#x2F;public&#x2F;&lt;&#x2F;url&gt;    </span><br><span class="line">	&lt;mirrorOf&gt;central&lt;&#x2F;mirrorOf&gt;            </span><br><span class="line">&lt;&#x2F;mirror&gt;</span><br></pre></td></tr></table></figure>

<p>这个配置文件以及配置文件里面配置的本地仓库的地址，都是我们在新建mavne项目的时候，使用的，可以回头看看我刚刚新建项目的时候，是不是用的就是这个文件，以及这个本地仓库地址。</p>

      
    </div>
    
    
    
    
    

    

    
      <div>
        <ul class="post-copyright">
  <li class="post-copyright-author">
    <strong>本文作者：</strong>
    Joy Wang
  </li>
  <li class="post-copyright-link">
    <strong>本文链接：</strong>
    <a href="https://joy_24.gitee.io/2020/11/25/ideaUseTutorial/" title="IDEA使用教程">https://joy_24.gitee.io/2020/11/25/ideaUseTutorial/</a>
  </li>
  <li class="post-copyright-license">
    <strong>版权声明： </strong>
    本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/3.0/" rel="external nofollow" target="_blank">CC BY-NC-SA 3.0</a> 许可协议。转载请注明出处！
  </li>
</ul>

      </div>
    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/myblogs/tags/IDEA/" rel="tag"># IDEA</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/myblogs/2020/11/13/idea-hotKey/" rel="next" title="IDEA常用快捷键列表">
                <i class="fa fa-chevron-left"></i> IDEA常用快捷键列表
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/myblogs/2020/11/25/rest1/" rel="prev" title="REST风格框架实战（从MVC到前后端分离）">
                REST风格框架实战（从MVC到前后端分离） <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      

      <section class="site-overview-wrap sidebar-panel sidebar-panel-active">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image"
                src="/myblogs/uploads/avatar.jpg"
                alt="" />
            
              <p class="site-author-name" itemprop="name"></p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                #<a href="/myblogs/archives%7C%7C%20archive">
                <a href="/myblogs/archives">
              
                  <span class="site-state-item-count">34</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/myblogs/categories/index.html">
                  <span class="site-state-item-count">9</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/myblogs/tags/index.html">
                  <span class="site-state-item-count">20</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          
            <div class="feed-link motion-element">
              <a href="/myblogs/atom.xml" rel="alternate">
                <i class="fa fa-rss"></i>
                RSS
              </a>
            </div>
          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/joyWJ" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="wangjianjoy@126.com" target="_blank" title="E-Mail">
                      
                        <i class="fa fa-fw fa-envelope"></i>E-Mail</a>
                  </span>
                
            </div>
          

          
          

          
          

          

        </div>
      </section>

      

      
        <div class="back-to-top">
          <i class="fa fa-arrow-up"></i>
          
            <span id="scrollpercent"><span>0</span>%</span>
          
        </div>
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2022</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Joy Wang</span>

  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Mist</a> v5.1.4</div>




        







        
      </div>
    </footer>

    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  


  











  
  
    <script type="text/javascript" src="/myblogs/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/myblogs/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/myblogs/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/myblogs/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/myblogs/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/myblogs/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  

  
  
    <script type="text/javascript" src="/myblogs/lib/canvas-nest/canvas-nest.min.js"></script>
  


  


  <script type="text/javascript" src="/myblogs/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/myblogs/js/src/motion.js?v=5.1.4"></script>



  
  

  
  <script type="text/javascript" src="/myblogs/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/myblogs/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/myblogs/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  

  <script type="text/javascript">
    // Popup Window;
    var isfetched = false;
    var isXml = true;
    // Search DB path;
    var search_path = "search.xml";
    if (search_path.length === 0) {
      search_path = "search.xml";
    } else if (/json$/i.test(search_path)) {
      isXml = false;
    }
    var path = "/myblogs/" + search_path;
    // monitor main search box;

    var onPopupClose = function (e) {
      $('.popup').hide();
      $('#local-search-input').val('');
      $('.search-result-list').remove();
      $('#no-result').remove();
      $(".local-search-pop-overlay").remove();
      $('body').css('overflow', '');
    }

    function proceedsearch() {
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay"></div>')
        .css('overflow', 'hidden');
      $('.search-popup-overlay').click(onPopupClose);
      $('.popup').toggle();
      var $localSearchInput = $('#local-search-input');
      $localSearchInput.attr("autocapitalize", "none");
      $localSearchInput.attr("autocorrect", "off");
      $localSearchInput.focus();
    }

    // search function;
    var searchFunc = function(path, search_id, content_id) {
      'use strict';

      // start loading animation
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay">' +
          '<div id="search-loading-icon">' +
          '<i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>' +
          '</div>' +
          '</div>')
        .css('overflow', 'hidden');
      $("#search-loading-icon").css('margin', '20% auto 0 auto').css('text-align', 'center');

      $.ajax({
        url: path,
        dataType: isXml ? "xml" : "json",
        async: true,
        success: function(res) {
          // get the contents from search data
          isfetched = true;
          $('.popup').detach().appendTo('.header-inner');
          var datas = isXml ? $("entry", res).map(function() {
            return {
              title: $("title", this).text(),
              content: $("content",this).text(),
              url: $("url" , this).text()
            };
          }).get() : res;
          var input = document.getElementById(search_id);
          var resultContent = document.getElementById(content_id);
          var inputEventFunction = function() {
            var searchText = input.value.trim().toLowerCase();
            var keywords = searchText.split(/[\s\-]+/);
            if (keywords.length > 1) {
              keywords.push(searchText);
            }
            var resultItems = [];
            if (searchText.length > 0) {
              // perform local searching
              datas.forEach(function(data) {
                var isMatch = false;
                var hitCount = 0;
                var searchTextCount = 0;
                var title = data.title.trim();
                var titleInLowerCase = title.toLowerCase();
                var content = data.content.trim().replace(/<[^>]+>/g,"");
                var contentInLowerCase = content.toLowerCase();
                var articleUrl = decodeURIComponent(data.url);
                var indexOfTitle = [];
                var indexOfContent = [];
                // only match articles with not empty titles
                if(title != '') {
                  keywords.forEach(function(keyword) {
                    function getIndexByWord(word, text, caseSensitive) {
                      var wordLen = word.length;
                      if (wordLen === 0) {
                        return [];
                      }
                      var startPosition = 0, position = [], index = [];
                      if (!caseSensitive) {
                        text = text.toLowerCase();
                        word = word.toLowerCase();
                      }
                      while ((position = text.indexOf(word, startPosition)) > -1) {
                        index.push({position: position, word: word});
                        startPosition = position + wordLen;
                      }
                      return index;
                    }

                    indexOfTitle = indexOfTitle.concat(getIndexByWord(keyword, titleInLowerCase, false));
                    indexOfContent = indexOfContent.concat(getIndexByWord(keyword, contentInLowerCase, false));
                  });
                  if (indexOfTitle.length > 0 || indexOfContent.length > 0) {
                    isMatch = true;
                    hitCount = indexOfTitle.length + indexOfContent.length;
                  }
                }

                // show search results

                if (isMatch) {
                  // sort index by position of keyword

                  [indexOfTitle, indexOfContent].forEach(function (index) {
                    index.sort(function (itemLeft, itemRight) {
                      if (itemRight.position !== itemLeft.position) {
                        return itemRight.position - itemLeft.position;
                      } else {
                        return itemLeft.word.length - itemRight.word.length;
                      }
                    });
                  });

                  // merge hits into slices

                  function mergeIntoSlice(text, start, end, index) {
                    var item = index[index.length - 1];
                    var position = item.position;
                    var word = item.word;
                    var hits = [];
                    var searchTextCountInSlice = 0;
                    while (position + word.length <= end && index.length != 0) {
                      if (word === searchText) {
                        searchTextCountInSlice++;
                      }
                      hits.push({position: position, length: word.length});
                      var wordEnd = position + word.length;

                      // move to next position of hit

                      index.pop();
                      while (index.length != 0) {
                        item = index[index.length - 1];
                        position = item.position;
                        word = item.word;
                        if (wordEnd > position) {
                          index.pop();
                        } else {
                          break;
                        }
                      }
                    }
                    searchTextCount += searchTextCountInSlice;
                    return {
                      hits: hits,
                      start: start,
                      end: end,
                      searchTextCount: searchTextCountInSlice
                    };
                  }

                  var slicesOfTitle = [];
                  if (indexOfTitle.length != 0) {
                    slicesOfTitle.push(mergeIntoSlice(title, 0, title.length, indexOfTitle));
                  }

                  var slicesOfContent = [];
                  while (indexOfContent.length != 0) {
                    var item = indexOfContent[indexOfContent.length - 1];
                    var position = item.position;
                    var word = item.word;
                    // cut out 100 characters
                    var start = position - 20;
                    var end = position + 80;
                    if(start < 0){
                      start = 0;
                    }
                    if (end < position + word.length) {
                      end = position + word.length;
                    }
                    if(end > content.length){
                      end = content.length;
                    }
                    slicesOfContent.push(mergeIntoSlice(content, start, end, indexOfContent));
                  }

                  // sort slices in content by search text's count and hits' count

                  slicesOfContent.sort(function (sliceLeft, sliceRight) {
                    if (sliceLeft.searchTextCount !== sliceRight.searchTextCount) {
                      return sliceRight.searchTextCount - sliceLeft.searchTextCount;
                    } else if (sliceLeft.hits.length !== sliceRight.hits.length) {
                      return sliceRight.hits.length - sliceLeft.hits.length;
                    } else {
                      return sliceLeft.start - sliceRight.start;
                    }
                  });

                  // select top N slices in content

                  var upperBound = parseInt('1');
                  if (upperBound >= 0) {
                    slicesOfContent = slicesOfContent.slice(0, upperBound);
                  }

                  // highlight title and content

                  function highlightKeyword(text, slice) {
                    var result = '';
                    var prevEnd = slice.start;
                    slice.hits.forEach(function (hit) {
                      result += text.substring(prevEnd, hit.position);
                      var end = hit.position + hit.length;
                      result += '<b class="search-keyword">' + text.substring(hit.position, end) + '</b>';
                      prevEnd = end;
                    });
                    result += text.substring(prevEnd, slice.end);
                    return result;
                  }

                  var resultItem = '';

                  if (slicesOfTitle.length != 0) {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + highlightKeyword(title, slicesOfTitle[0]) + "</a>";
                  } else {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + title + "</a>";
                  }

                  slicesOfContent.forEach(function (slice) {
                    resultItem += "<a href='" + articleUrl + "'>" +
                      "<p class=\"search-result\">" + highlightKeyword(content, slice) +
                      "...</p>" + "</a>";
                  });

                  resultItem += "</li>";
                  resultItems.push({
                    item: resultItem,
                    searchTextCount: searchTextCount,
                    hitCount: hitCount,
                    id: resultItems.length
                  });
                }
              })
            };
            if (keywords.length === 1 && keywords[0] === "") {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-search fa-5x" /></div>'
            } else if (resultItems.length === 0) {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>'
            } else {
              resultItems.sort(function (resultLeft, resultRight) {
                if (resultLeft.searchTextCount !== resultRight.searchTextCount) {
                  return resultRight.searchTextCount - resultLeft.searchTextCount;
                } else if (resultLeft.hitCount !== resultRight.hitCount) {
                  return resultRight.hitCount - resultLeft.hitCount;
                } else {
                  return resultRight.id - resultLeft.id;
                }
              });
              var searchResultList = '<ul class=\"search-result-list\">';
              resultItems.forEach(function (result) {
                searchResultList += result.item;
              })
              searchResultList += "</ul>";
              resultContent.innerHTML = searchResultList;
            }
          }

          if ('auto' === 'auto') {
            input.addEventListener('input', inputEventFunction);
          } else {
            $('.search-icon').click(inputEventFunction);
            input.addEventListener('keypress', function (event) {
              if (event.keyCode === 13) {
                inputEventFunction();
              }
            });
          }

          // remove loading animation
          $(".local-search-pop-overlay").remove();
          $('body').css('overflow', '');

          proceedsearch();
        }
      });
    }

    // handle and trigger popup window;
    $('.popup-trigger').click(function(e) {
      e.stopPropagation();
      if (isfetched === false) {
        searchFunc(path, 'local-search-input', 'local-search-result');
      } else {
        proceedsearch();
      };
    });

    $('.popup-btn-close').click(onPopupClose);
    $('.popup').click(function(e){
      e.stopPropagation();
    });
    $(document).on('keyup', function (event) {
      var shouldDismissSearchPopup = event.which === 27 &&
        $('.search-popup').is(':visible');
      if (shouldDismissSearchPopup) {
        onPopupClose();
      }
    });
  </script>





  

  

  

  
  

  

  

  

</body>
</html>
